<div class="main-content">
  <header>
    <h2>Order #<?php echo $order->id; ?></h2>
  </header>

  <section>
    <?php echo $this->renderPartial('/partials/_notifications'); ?>
    <fieldset style="text-align:center;">
      <legend>User Info</legend>
      
      <p>
        <label>Name :</label>
        <?php echo $order->name; ?>
      </p>
      
      <p>
        <label>Email :</label>
        <?php echo $order->email; ?>
      </p>
      
      <p>
        <label>Address :</label>
        <?php echo $order->address; ?>
      </p>
      
      <p>
        <label>Phone :</label>
        <?php echo $order->phone; ?>
      </p>
      
      <p>
        <label>Created At :</label>
        <?php echo Helpers::customDate($order->created_at); ?>
      </p>
      
      <p>
        <label>Modified At :</label>
        <?php echo Helpers::customDate($order->modified_at); ?>
      </p>
    </fieldset>
    
    <fieldset>
      <legend>Order Info</legend>
      
      <table class="datatable paginate sortable full">
			<thead>
				<tr>
          <th>Code</th>
					<th>Quantity</th>
					<th>Description</th>
					<th>Status</th>
					<th style="width:70px"></th>
				</tr>
			</thead>
			<tbody>
        <?php foreach($order->detail_orders as $detail){ ?>
        <tr>
          <td style="text-align:center;"><?php echo $detail->code; ?></td>
          <td style="text-align:center;"><?php echo $detail->quantity; ?></td>
          <td style="text-align:center;"><?php echo $detail->description; ?></td>
          <td style="text-align:center;"><?php if($detail->status == Orders::STATUS_PENDING){echo "On Process";} else{echo "Approved";} ?></td>
          <td style="text-align:center;">
            <ul class="action-buttons">
              <?php if($detail->status == Orders::STATUS_PENDING){ ?>
                <li><a href="<?php echo bu('admin/orders/approve'); ?>?id=<?php echo $detail->id; ?>" method="POST" class="button button-gray no-text"><span class="accept"></span>Approve</a></li>
              <?php }else{ ?>
                <li><a href="<?php echo bu('admin/orders/decline'); ?>?id=<?php echo $detail->id; ?>" method="POST" class="button button-gray no-text"><span class="decline"></span>Decline</a></li>
              <?php } ?>
                <li><a href="<?php echo bu('admin/orders/delete'); ?>?id=<?php echo $detail->id; ?>" method="POST" class="button button-gray no-text"><span class="bin"></span>Delete</a></li>
						</ul>
          </td>
        </tr>
        <?php } ?>
      </tbody>
      </table>
    </fieldset>
  </section>
</div>